The Tab View Component > FTabView.sortItemsBy() |
FTabView.sortItemsBy()
Availability
Flash Player 6.
Usage
myTab_tbv.sortItemsBy (field
[,order])
Parameters
field A String specifying the field within the data associated
with the component that the tabs will be sorted by.
order An optional string, which if specified and set to "DESC" will sort the component in descending order.
Returns
Nothing
Description
This methods sorts the component by the field specified in the first parameter. If "DESC" is passed in as the second parameter, the component will be sorted in descending order. Otherwise, the component sorts in ascending order.
Notes
The name of the property that contains the name of the tab can be changed using the setLabelField method. The default value is "label".
Example
The tab_sortItemsBy.fla example file contains an example of using this method.
The following code adds four tabs, and then sort them in descending order.
var tabs = ["Tab 1","Tab 2","Tab 3","Tab 4"];
myTab_tbv.setDataProvider(tabs);
myTab_tbv.sortItemsBy("label", "DESC");
See also